use std::collections::BTreeMap;

pub fn transform(h: &BTreeMap<i32, Vec<char>>) -> BTreeMap<char, i32> {
    let mut result = BTreeMap::new();
    for (&i, v) in h.iter() {
        for &ch in v.iter() {
            result.insert(ch.to_ascii_lowercase(), i);
        }
    }
    result
}
